<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="${pageContext.request.contextPath}/statics/js/jquery-1.8.3.min.js"></script>
</head>
<body>
<form action="Add" method="post">
    <table>
        <tr>
            <th colspan="2">我的工作笔记</th>
        </tr>
        <tr>
            <td>标题：</td>
            <td><input type="text" id="title" name="title"></td>
        </tr>
        <tr>
            <td>内容：</td>
            <td><textarea name="content" id="content"></textarea></td>
        </tr>
        <tr>
            <td>类别:</td>
            <td>
                <select name="type"id="type">
                    <option value="0">-请选择类别-</option>
                    <option value="1">技术</option>
                    <option value="2">行政</option>
                    <option value="3">人事</option>
                </select>
            </td>
        </tr>
        <tr>
            <th colspan="2"><input type="submit"></th>
        </tr>
    </table>
</form>
<script>
    $(function () {
        $("form").submit(function () {
            if ($("#title").val()===""){
                alert("标题不能为空,请填写")
                return false;
            }else if ($("#type").val()===""){
                alert("请选择类别")
                return false;
            }else {
                alert("添加成功")
                return true;
            }

        })
    })
</script>
</body>
</html>
